London | ITP - Jan-2026 | Ping Wang | Sprint 2 | coursework#935
London | ITP - Jan-2026 | Ping Wang | Sprint 2 | coursework#935pathywang wants to merge 23 commits intoCodeYourFuture:mainfrom
Conversation
Sprint-2/1-key-errors/0.js
Outdated
|
|
||
| // =============> write your explanation here | ||
| // =============> write your new code here | ||
| // the input "str" is the same as output "str" which is not allowed in JS |
There was a problem hiding this comment.
The ability to describe and explain code using proper terminology is essential for a software developer.
"str" is neither an input or output. Can you rephrase the statement on line 12?
Feel free to use AI to help you learn how to describe or explain code, and take note of the terminology it suggests.
Sprint-2/2-mandatory-debug/0.js
Outdated
| // So, we’ll see:csharp | ||
| // Copy | ||
| // Edit | ||
| // 320 |
There was a problem hiding this comment.
What are these "csharp", "Copy", ...?
| } No newline at end of file | ||
| function calculateBMI(weight, height) { | ||
| const bmi= weight/(height*height); | ||
| return bmi.toFixed(1); |
There was a problem hiding this comment.
What type of value do you expect your function to return? A number or a string?
Does your function return the type of value you expect?
Different types of values may appear identical in the console output, but they are represented and treated differently in the program. For example,
console.log(123); // Output 123
console.log("123"); // Output 123
// Treated differently in the program
let sum1 = 123 + 100; // Evaluate to 223 -- a number
let sum 2 = "123" + 100; // Evaluate to "123100" -- a string.| // The function to convert any string to UPPER_SNAKE_CASE: | ||
|
|
||
| function toUpperSnakeCase(input) { | ||
| return input.trim().toUpperCase().replace(/\s+/g, "_");} |
There was a problem hiding this comment.
Note: Common practice is the place the closing } by itself on a separate line.
If you install "prettier" extension on VSCode, you can also use VSCode "Format Document" feature to auto indent JS code.
|
Changes look good. Well done. |
Changelist
After i study prep with notes, i completed coursework with node to check my code on my example2.js file. What is more, i made notes on my notebook to review later because i did get some help from AI tool and hopefully i can do on my own without any help next time